package com.cndcare.msc.bean;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Data
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PcBean {
    public static final String ALL = "ALL"; // 全部
    public static final String ONLINE = "ONLINE"; // 在线
    public static final String OFFLINE = "OFFLINE"; // 离线
    public static final String WARN = "WARN"; // 亚健康
    public static final String DANGER = "DANGER"; // 告警

    public static Map<String, Object> statsDicMap;
    public static Map<String, Integer> levelMap;
    static  {
        statsDicMap = new HashMap<>();

        statsDicMap.put(PcBean.ONLINE, "在线");
        statsDicMap.put(PcBean.OFFLINE, "离线");
        statsDicMap.put(PcBean.WARN, "异常");
        statsDicMap.put(PcBean.DANGER, "警报");

        levelMap = new HashMap<>();
        levelMap.put(PcBean.ONLINE, 2);
        levelMap.put(PcBean.OFFLINE, 1);
        levelMap.put(PcBean.WARN, 3);
        levelMap.put(PcBean.DANGER, 4);
    }

    public static final String COMPLETE = "COMPLETE"; // 信息完整
    public static final String UN_COMPLETE = "UN_COMPLETE"; // 信息不完整
    public static final String INFO_CONFLICT = "INFO_CONFLICT"; // 信息异常

    public static Map<String, Object> infoStatusMap;
    static  {
        infoStatusMap = new HashMap<>();

        infoStatusMap.put(PcBean.COMPLETE, "在线");
        infoStatusMap.put(PcBean.UN_COMPLETE, "地址或备注未填写");
        infoStatusMap.put(PcBean.INFO_CONFLICT, "IP与登记不一致");
    }

    private Long id;

    private String mac;
    private String ip;
    private String realIp;
    private String address;
    private String remark;
    private String status;
    private Integer level;
    private String infoStatus;
    private Date createTime;
    private Date updateTime;
}
